package com.tanhua.server.controller;

import com.tanhua.server.serivce.SoulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/testSoul")
public class SoulController {
    @Autowired
    private SoulService soulService;

    /**
     * 接口名称：测灵魂-问卷列表（学生实战）
     * 接口路径：GET/testSoul
     */
    @GetMapping
    public ResponseEntity<Object> questionnaireList() {
        return soulService.questionnaireList();
    }

    /**
     * 接口名称：测灵魂-提交问卷（学生实战）
     * 接口路径：POST/testSoul
     */
    @PostMapping
    public ResponseEntity<Object> submit(@RequestBody String answers) {

        return soulService.submitQuestionnaire(answers);
    }

    /**
     * 测灵魂-查看结果（学生实战）
     * 接口路径：GET/testSoul/report/:id
     */
    @GetMapping("/report/{id}")
    public ResponseEntity<Object> queryReport(@PathVariable String id) {
        return soulService.queryReport(id);
    }
}